package com.zhdl.modules.prefiresys.entity;

import com.project.common.bean.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 探测器防区信息
 *
 * @author ACodeYuan
 * @Description:
 * @date 2023/7/21 16:15
 * @Version Y-1.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "detector_area_info")
public class DetectorAreaInfo extends BaseEntity<DetectorAreaInfo, String> {
    /**
     * ID
     */
    @Id
    @Column(length = 32)
    private String id;

    /**
     * 探测器Id, uuid类型
     */
    @Column(nullable = false)
    private String detectorId;

    /**
     * 探测器地址，1-255，冗余字段
     */
    @Column(nullable = false)
    private short detectorAddr;

    /**
     * 防区编号 1-4
     */
    @Column(nullable = false, columnDefinition = "TINYINT default 1")
    private byte areaNo;

    /**
     * 防区名称
     */
    @Column(nullable = false)
    private String areaName;

    /**
     * 状态 0 未启用 1启用
     */
    @Column(nullable = false, columnDefinition = "BIT default 1")
    private boolean status;

    /**
     * 当前报警状态 0x40 U8 1防区 报警状态 0 正常；1 预警；2 三级报警；3 二级报警；4 一级报警；5 报警保持；
     */
    @Column(nullable = false, columnDefinition = "TINYINT default 0")
    private byte alarmStatus;

    /**
     * 当前报警状态发生的时间
     */
    @Column(nullable = false, columnDefinition = "datetime default current_timestamp")
    private String alarmStatusAt;

}
